package com.arpa.oms.domain.enums;

import com.arpa.wms.domain.enums.StatusEnum;
import com.baomidou.mybatisplus.core.enums.IEnum;

import java.util.HashMap;
import java.util.Map;

public enum  OmsUnpackRuleEnum implements IEnum<String> {
    /**
     * 是否按全部商品拆分
     */
    PART_GOODS("0", "否"),
    ALL_GOODS("1", "是");

    /**
     * 值
     */
    private final String value;

    /**
     * 描述
     */
    private final String desc;

    OmsUnpackRuleEnum(final String value, final String desc) {
        this.value = value;
        this.desc = desc;
    }

    private static final Map<String, OmsUnpackRuleEnum> map = new HashMap();

    static {
        OmsUnpackRuleEnum[] values = values();
        int length = values.length;
        for(int i = 0; i < length; i++){
            OmsUnpackRuleEnum value1 = values[i];
            map.put(value1.getValue(),value1);
        }
    }

    public static OmsUnpackRuleEnum getEnumByValue(String value){

        return map.get(value);
    }
    @Override
    public String getValue() {
        return this.value;
    }

    @Override
    public String toString(){
        return this.desc;
    }

    public String getDesc() {
        return this.desc;
    }
}
